import threading
from logger import LogManager

# 多线程示例
logger = LogManager.get_both_logger(name='multithread_logger', log_file='examples/multithread_example.log')

def worker(thread_id):
    logger.info(f'线程 {thread_id} 正在执行任务')

if __name__ == '__main__':
    threads = []
    for i in range(3):
        t = threading.Thread(target=worker, args=(i,))
        threads.append(t)
        t.start()

    for t in threads:
        t.join()

    logger.info('所有线程执行完毕')